<div class="form-group">
  <div class="col-md-2 control-label">
    <label for="testpaper-percentage-field">{{'course.testpaper_manage.create.build_mode'|trans}}</label>
  </div>
  <div class="col-md-8 controls radios">
    {{ radios('mode', {'rand':'course.testpaper_manage.create.build_mode.rand'|trans, 'difficulty':'course.testpaper_manage.create.build_mode.difficulty'|trans}, 'rand') }}
  </div>
</div>

<div class="form-group hidden" id="difficulty-form-group">
  <div class="col-md-2 control-label">
    <label for="testpaper-percentage-field">{{'course.testpaper_manage.create.difficulty'|trans}}</label>
  </div>
  <div class="col-md-8 controls mtm">
    <div class="mbm" id="difficulty-percentage-slider"></div>
    <p class="help-block mbm">
      <span class="js-simple-percentage-text"></span>
      <span class="js-normal-percentage-text"></span>
      <span class="js-difficulty-percentage-text"></span>
    </p>
    <span class="color-warning">{{'course.testpaper_manage.create.difficulty.tips'|trans}}</span>
  </div>
</div>

<div class="form-group">
  <div class="col-md-2 control-label"><label for="testpaper-range-field">{{'course.testpaper_manage.create.range'|trans}}</label></div>
  <div class="col-md-8 controls">
    {#{{ radios('range', {'course':'整个课程'|trans, 'lesson':'按任务范围'|trans}, 'course') }}
    <div class="hidden mtm" id="testpaper-range-selects">
      <select class="form-control width-input width-input-large" id="testpaper-range-start" name="ranges[start]" >
        <option value="">请选择</option>
        {% for range in ranges if range %}
          <option value="{{ range.id }}">{{ range.title }}</option>
        {% endfor %}
      </select>
      <span class="color-gray mrs">{{'到'|trans}}</span>
      <select class="form-control width-input width-input-large" id="testpaper-range-end" name="ranges[end]">
        <option value="">请选择</option>
        {% for range in ranges if range %}
          <option value="{{ range.id }}">{{ range.title }}</option>
        {% endfor %}
      </select>
    </div>#}
    <select class="form-control width-150" name="ranges[courseId]" data-url="{{ path('course_set_manage_show_tasks',{courseSetId:courseSet.id})}}" data-check-num-url="{{ path('course_set_manage_question_check_num',{courseSetId:courseSet.id}) }}">
      <option value="0" {% if not range.courseId|default(0) %}selected{% endif %}>{{'course.testpaper_manage.create.range.course'|trans}}</option>
      {% for course in courses if course %}
        <option value="{{ course.id }}" {% if range.courseId|default(0) == course.id %}selected{% endif %}>{{ get_course_title(course) }}</option>
      {% endfor %}
    </select>
    <select class="form-control width-150" {% if not showTasks|default(null) %}style="display:none;"{% endif %} name="ranges[lessonId]" data-check-num-url="{{ path('course_set_manage_question_check_num',{courseSetId:courseSet.id}) }}">
      <option value="0" {% if not range.lessonId|default(0) %}selected{% endif %}>{{'course.testpaper_manage.create.range.choose'|trans}}</option>
      {% for task in showTasks|default([]) if task %}
        <option value="{{ task.id }}" {% if range.lessonId|default(0) == task.id %}selected{% endif %}>{{ task.title }}</option>
      {% endfor %}
    </select>
  </div>
</div>

<div class="form-group">
  <style>.testpaper-question-option-item{margin-left:-12px;margin-bottom:5px;list-style: none;}</style>
  <div class="col-md-2 control-label"><label class="control-label-required">{{'course.testpaper_manage.create.questions_setup'|trans}}</label></div>
  <ul class="col-md-10 controls" id="testpaper-question-options">
    {% for type,config in types %}
      <li class="testpaper-question-option-item">
        <button type="button" class="btn btn-link question-type-sort-handler"><span class="glyphicon glyphicon-move"></span></button>
        <span style="min-width:85px;display:inline-block;_display:inline;">{{ config.name|trans }}</span>
        <span class="mlm">{{'course.testpaper_manage.create.questions_setup.number'|trans}}:</span>
        <input type="text" class="form-control width-input width-input-mini item-number" name="counts[{{ type }}]" data-role="count"  value="0" {% if questionNums[type].questionNum|default(0) == 0  %} disabled {% endif %} />/
        <span class="text-info question-num" role="questionNum" type="{{ type }}" style="display:inline-block;min-width: 45px;">{{ questionNums[type].questionNum|default(0) }}</span>

        <span class="mlm">{{'course.testpaper_manage.create.questions_setup.score'|trans}}:</span>
        <input type="text" class="form-control width-input width-input-mini item-score" name="scores[{{ type }}]"  value="2" data-role="score" />

        {% if config.hasMissScore|default(null) %}
          <span class="mlm">{{'course.testpaper_manage.create.questions_setup.missing_score'|trans}}:</span>
          <input type="text" class="form-control width-input width-input-mini item-miss-score" name="missScores[{{ type }}]"  value="0" data-role="missScore" />
        {% endif %}
      </li>
    {% endfor %}
    <input type="hidden" name="questioncount">
    <span class="help-block color-danger js-build-check"></span>
  </ul>

</div>

<input type="hidden" name="percentages[simple]">
<input type="hidden" name="percentages[normal]">
<input type="hidden" name="percentages[difficulty]">
